package com.yl.order;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;


import com.yl.common.utils.ShellUtils;

import java.util.Objects;

/**
 * Created by bpb on 2019/11/7.
 * 说明：
 */
public class BootReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        if (Objects.equals(intent.getAction(), Intent.ACTION_BOOT_COMPLETED)) {//开机启动广播
            try {
                String[] cmd = new String[]{"am start com.yl.order/com.yl.order.ui.MainActivity", "setprop service.adb.tcp.port 5555", "stop adbd", "start adbd"};
                ShellUtils.execCommand(cmd, true, false);
            } catch (Exception ignore) {

            }

        }
    }
}
